#ifndef __GE_FRAMEBUFFEROBJECT_H__
#define __GE_FRAMEBUFFEROBJECT_H__

#include "GE_Base.h"

namespace Syp
{
	///A FrameBufferObject is an object which holds buffers which can be rendered to offscreen. 
	///Example of uses include RTT(Render to Texture).
	class SYPAPI FrameBufferObject
	{
	public:
		///Constructor, should not be called by user, use Renderer::generateFBOObj() instead
		FrameBufferObject(PInt iD,PInt w,PInt h):id(iD),width(w),height(h){};

		static void destroyFrameBufferObject(FrameBufferObject* fbo);
		///Attaches a BufferObject to this FBO. BufferObjects represent the actual parts to which information will be rendered to
		void attachBuffer(BufferObject* bo);	
		///Attach an ordinary Texture instead of a BufferObject
		void attachTexture(TextureObj* tex);
		///Retrieves hardware id of FBO to be used by Renderer
		PInt getId();
		///Binds this FBO, all rendering done after this will be rendered to the FBO
		void bindFBO();
		///Unbinds the FBO
		void unBindFBO();
		///Returns the width of the FBO
		PInt getWidth();
		///Returns the height of the FBO
		PInt getHeight();
	private:
		PInt width;
		PInt height;
		///Destructor, use FrameBufferObject::destroyFrameBufferObject to destroy a FrameBufferObject
		~FrameBufferObject();
		///the id of this FBO object
		PInt id;
		std::vector<BufferObject> buffers;		
	};

}
#endif